$OpenBSD: patch-numpy_core_include_numpy_npy_common_h,v 1.5 2016/03/18 13:26:10 daniel Exp $

(1) optimize function attributes were added in gcc 4.4. Apply a fix for the warnings. But
the next release of numpy should fix this in a better way. See:
https://github.com/numpy/numpy/issues/5451

Gets rid of these warnings from the build:
numpy/core/src/multiarray/lowlevel_strided_loops.c.src:120: warning: 'optimize' attribute directive ignored

(2) py-numpy only checks for expl to determine whether extended-precision
support is present.  since we don't have it yet;  it implements
it's own.  however, on alpha, powerpc, it declared functions with
types that conflict with C99 (double for *l), therefore failed.

--- numpy/core/include/numpy/npy_common.h.orig	Sun Nov 16 17:31:16 2014
+++ numpy/core/include/numpy/npy_common.h	Sun Mar  6 15:22:08 2016
@@ -7,6 +7,7 @@
 #include <npy_config.h>
 #endif
 
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 4)))
 /*
  * gcc does not unroll even with -O3
  * use with care, unrolling on modern cpus rarely speeds things up
@@ -17,13 +18,20 @@
 #else
 #define NPY_GCC_UNROLL_LOOPS
 #endif
+#else
+#define NPY_GCC_UNROLL_LOOPS
+#endif
 
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 4)))
 /* highest gcc optimization level, enabled autovectorizer */
 #ifdef HAVE_ATTRIBUTE_OPTIMIZE_OPT_3
 #define NPY_GCC_OPT_3 __attribute__((optimize("O3")))
 #else
 #define NPY_GCC_OPT_3
 #endif
+#else
+#define NPY_GCC_OPT_3
+#endif
 
 /*
  * mark an argument (starting from 1) that must not be NULL and is not checked
@@ -288,14 +296,8 @@ typedef unsigned char npy_bool;
 #define NPY_FALSE 0
 #define NPY_TRUE 1
 
-
-#if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE
-        typedef double npy_longdouble;
-        #define NPY_LONGDOUBLE_FMT "g"
-#else
-        typedef long double npy_longdouble;
-        #define NPY_LONGDOUBLE_FMT "Lg"
-#endif
+typedef long double npy_longdouble;
+#define NPY_LONGDOUBLE_FMT "Lg"
 
 #ifndef Py_USING_UNICODE
 #error Must use Python with unicode enabled.
